package com.example.infomanagesystem.exception;


import com.example.infomanagesystem.common.ErrorCode;


/**
 * 自定义异常类
 *
 * @author xsp
 */

public class BusinessException extends RuntimeException {

    /**
     * 异常码
     */
    private final int status;



    public BusinessException(int status,String message) {
        super(message);
        this.status = status;
    }

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.status = errorCode.getStatus();
    }





    public int getStatus() {
        return this.status;
    }


}
